import request from '@/utils/request'
import qs from 'qs'

const ha_appsettingApi = {
  list: '/ha_appsetting/list',
  save: '/ha_appsetting/save',
  view: '/ha_appsetting/view',
  del: '/ha_appsetting/delete',
  dels: '/ha_appsetting/batchDel',
  output: '/ha_appsetting/output',
  downloadModal: '/ha_appsetting/downloadModal',
  importModal: '/ha_appsetting/importExcel'
}

/**
 * 导入系统配置
 */
export function importModal (data) {
  var body = new FormData()
  body.append('file', data)
  return request({
    url: ha_appsettingApi.importModal,
    headers: { 'Conten-Type': 'mulitpart/form-data' },
    method: 'post',
    data: body
  })
}

/**
 * 下载导入模板-系统配置
 */
export function downloadModal () {
  return request({
    url: ha_appsettingApi.downloadModal,
    method: 'post',
    responseType: 'blob'
  })
}

/**
 * 导出系统配置
 */
export function output (data) {
  return request({
    url: ha_appsettingApi.output,
    method: 'post',
    data: data,
    responseType: 'blob'
  })
}
/**
 * 批量删除系统配置
 * @param {*} parameter
 */
export function delHa_appsettings (ids) {
  return request({
    url: ha_appsettingApi.dels,
    params: ids,
    method: 'post'
  })
}
/**
 * 删除系统配置
 * @param {*} id
 */
export function delHa_appsetting (id) {
  return request({
    url: ha_appsettingApi.del + '/' + id,
    method: 'post'
  })
}
/**
 * 查看、编辑系统配置
 * @param {*} id
 */
export function viewHa_appsetting (id) {
  return request({
    url: ha_appsettingApi.view + '/' + id,
    method: 'post'
  })
}
/**
 * 保存系统配置
 * @param {*} parameter
 */
export function saveHa_appsetting (parameter) {
  return request({
    url: ha_appsettingApi.save,
    method: 'post',
    data: parameter
  })
}
/**
 * 查询系统配置列表
 * @param {*} parameter
 */
export function queryHa_appsettingList (parameter) {
  return request({
    url: ha_appsettingApi.list,
    method: 'post',
    data: parameter
  })
}
